WebSocketStatus
WebSocketStatus
The WebSocketStatus component is a React component that displays the status of the WebSocket connection. It uses the useSelector hook from react-redux to access the messages from the Redux store and displays them in a list.
Usage
import WebSocketStatus from './WebSocketStatus';
const MyComponent = () => {
return (
<div>
<WebSocketStatus />
{/* Other content */}
</div>
);
};
Props
This component does not accept any props.
Styling
The component does not have any specific styling, but the font size of the message list is set to .3em using inline styles.
Notes
- This component requires the
websocketreducer to be set up in the Redux store. - The
websocketreducer should contain an array ofWebsocketMessageobjects, each with atypeandpayloadproperty. - The component differentiates between
ERRORmessages and other messages, displaying them with different formatting.